package rush.edu.wechat.common.service.mybatis;


import com.baomidou.mybatisplus.entity.GlobalConfiguration;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import rush.edu.wechat.common.service.db.DbConfig;

import javax.sql.DataSource;


/**配置bei数据源
 * Created by hmily on 2017/8/29.
 * @Configuration
 * @Profile("master")
 * @MapperScan(basePackages = "com.mult.*.dao" ,sqlSessionTemplateRef = "masterSqlSessionTemplate")
 */
public interface MybatisConfig {

    DataSource dataSource(DbConfig dbConfig);

    SqlSessionFactory sqlSessionFactory(DataSource dataSource ,GlobalConfiguration globalConfiguration,DbConfig dbConfig) throws Exception;

    SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory);

    GlobalConfiguration devGlobalConfiguration(DbConfig dbConfig );
}
